<template>
  <div class="city-wrap">
  <city-header></city-header>
  <city-search :cities='cities'></city-search>
  <city-list :hotcities='hotCities' :cities='cities'></city-list>
  </div>
</template>

<script>
  // 引用
  import CityHeader from './components/Header'
  import CitySearch from './components/Search'
  import CityList from './components/List'
  //下载axios，引用
  import axios from 'axios';
  export default{
    name:'City',
    data (){
      return {
        hotCities:[],
        cities:[]
      }
    },
    components:{
      CityHeader,
      CitySearch,
      CityList
    },
    mounted:function(){
      axios.get('goWhereData/city.json')
          .then((res)=>{
            let resData = res.data.data;
            this.hotCities=resData.hotCities;
            this.cities=resData.cities;
          });
    }
  }
</script>

<style scoped="scoped">

</style>
